<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="body-main">
    <div class="dggui-panel">
        <form id="workEntryTable">
            <table class="dggui-table cell-border table-form">
                <thead>
                <c:if test="${workEntry.recordType == 1}">
                    <th>权证人员</th>
                    <th>办理日期</th>
                    <th>办理区域</th>
                    <th>办理类型</th>
                    <th>办理地点</th>
                </c:if>
                <c:if test="${workEntry.recordType == 2}">
                    <th>资料人员</th>
                    <th>银行</th>
                    <th>办理日期</th>
                    <th>办理类型</th>
                    <th>办理数量</th>
                </c:if>
                <c:if test="${workEntry.recordType == 3}">
                    <th>评估人员</th>
                    <th>办理日期</th>
                    <th>评估公司</th>
                    <th>银行</th>
                </c:if>
                <c:if test="${workEntry.recordType == 4}">
                    <th>驻点人员</th>
                    <th>放款日期</th>
                    <th>放款金额</th>
                    <th>产品名称</th>
                    <th>渠道</th>
                </c:if>
                <th>备注</th>
                </thead>
                <tbody>
                <tr>
                    <td>${workEntry.manageUserName}</td>
                    <c:if test="${workEntry.recordType == 1}">
                        <td>
                            <input type="text" readonly class="dggui-input dggui-time-range" value="<fmt:formatDate value="${workEntry.handleTime}" pattern="yyyy-MM-dd"/>" name="handleTime">
                            <i class="iconfont icon-rili"></i>
                        </td>
                        <td>
                            <select class="dggui-select" name="handleArea">
                                <c:forEach items="${blqyList}" var="blqy">
                                        <option value="${blqy.handleCode}" <c:if test="${blqy.handleCode == workEntry.handleArea}">selected</c:if>>${blqy.handleValue}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td>
                            <select class="dggui-select" name="handleType">
                                <c:forEach items="${bllxList}" var="bllx">
                                    <option value="${bllx.handleCode}" <c:if test="${bllx.handleCode == workEntry.handleType}">selected</c:if>>${bllx.handleValue}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td><input type="text" name="handlePlace"value="${workEntry.handlePlace}" class="dggui-input"></td>
                    </c:if>
                    <c:if test="${workEntry.recordType == 2}">
                        <td><input type="text" name="bank" value="${workEntry.bank}" class="dggui-input"></td>
                        <td>
                            <input type="text" readonly class="dggui-input dggui-time-range" value="<fmt:formatDate value="${workEntry.handleTime}" pattern="yyyy-MM-dd"/>" name="handleTime">
                            <i class="iconfont icon-rili"></i>
                        </td>
                        <td>
                            <select class="dggui-select" name="handleType">
                                <c:forEach items="${bllxList}" var="bllx">
                                    <option value="${bllx.handleCode}" <c:if test="${bllx.handleCode == workEntry.handleType}">selected</c:if>>${bllx.handleValue}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td><input type="text" name="handleNum" value="${workEntry.handleNum}" class="dggui-input"></td>
                    </c:if>
                    <c:if test="${workEntry.recordType == 3}">
                        <td>
                            <input type="text" readonly class="dggui-input dggui-time-range" value="<fmt:formatDate value="${workEntry.handleTime}" pattern="yyyy-MM-dd"/>" name="handleTime">
                            <i class="iconfont icon-rili"></i>
                        </td>
                        <td><input type="text" name="assessmentCompany" value="${workEntry.assessmentCompany}" class="dggui-input"></td>
                        <td><input type="text" name="bank" value="${workEntry.bank}" class="dggui-input"></td>
                    </c:if>
                    <c:if test="${workEntry.recordType == 4}">
                        <td>
                            <input type="text" readonly class="dggui-input dggui-time-range" value="<fmt:formatDate value="${workEntry.loanTime}" pattern="yyyy-MM-dd"/>" name="loanTime">
                            <i class="iconfont icon-rili"></i>
                        </td>
                        <td><input type="text" name="loanMoney" value="${workEntry.loanMoney}" oninput="calcContractMoneyF(this)" class="dggui-input"></td>
                        <td><input type="text" name="productName" value="${workEntry.productName}" class="dggui-input"></td>
                        <td><input type="text" name="channelName" value="${workEntry.channelName}" class="dggui-input"></td>
                    </c:if>
                    <td><input type="text" name="remark" value="${workEntry.remark}" class="dggui-input"></td>
                </tr>
                </tbody>
                <input type="hidden" id="id" name="id" value="${workEntry.id}">
                <input type="hidden" id="manageUserId" name="manageUserId" value="${workEntry.manageUserId}">
                <input type="hidden" id="recordType" name="recordType" value="${workEntry.recordType}">
                <input type="hidden" id="productOrgId" name="productOrgId" value="${workEntry.productOrgId}">
                <input type="hidden" id="userId" name="userId" value="${userEntity.id}">
            </table>
        </form>
    </div>
</div>
<script>

    dggui.use(['dggdate'], function () {
        var dggdate = dggui.dggdate;
        //初始化日期下拉框
        //同时绑定多个
        lay('input[name = "handleTime"]').each(function () {
            dggdate.render({
                elem: this,
                trigger: 'click',
                type: 'date'
            });
        });
        lay('input[name = "loanTime"]').each(function () {
            dggdate.render({
                elem: this,
                trigger: 'click',
                type: 'date'
            });
        });
    });
</script>